<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<link rel="stylesheet" href="${ctx}/jslib/layui/css/layui.css" media="all">
<link rel="stylesheet" href="${ctx}/css/common.css" />
<link rel="stylesheet" href="${ctx}/css/index.css" type="text/css" />
<script type="text/javascript" src="${ctx}/jslib/layer/layer.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/js/main.js" charset="utf-8"></script>

<script type="text/javascript">
var ctx = "${ctx}"; 
<c:if test='${sessionInfo.id == null}'>
	window.location.href='${ctx}/admin/index';
</c:if>
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
function closeWin(){
    parent.layer.close(index);
}
$(function(){
	function getInformation(){
		$.ajax({
			type:"post",
			url:"${ctx}/msg/message",
			success:function(data){
				for(var i=0;i<data.obj.length;i++){
					var prefix=data.obj[i];
					var url="${ctx}/msg/messageView?createUser="+prefix.createUser+
							"&endTime="+prefix.endTime+"&startTime="+prefix.startTime+
							"&tradeType="+prefix.tradeType+"&status="+prefix.status+"&type="+prefix.type;
					if(prefix.type == 1){
						$("#rechargeCheck").html(data.obj[i].count);
						/* $("#arechargeCheck").attr("href",url); */
						$("#arechargeCheck").click(function(){
							window.location.href=url;//充值记录
						});
						
					}else if(prefix.type == 2){
						$("#withdrawCheck").html(data.obj[i].count);
						$("#awithdrawCheck").click(function(){
							window.location.href=url;//提现记录
						});
					}else if(prefix.type == 3){
						$("#ticketPay").html(data.obj[i].count);
						$("#aticketPay").click(function(){
							window.location.href=url;//待支付
						});
					}else if(prefix.type == 4){
						$("#withdrawPay").html(data.obj[i].count);
						$("#awithdrawPay").click(function(){
							window.location.href=url;//切位订单
						});
					}else if(prefix.type == 5){
						$("#contractCheck").html(data.obj[i].count);
						$("#acontractCheck").click(function(){
							window.location.href=url;//切位订单
						});
					}else if(prefix.type == 6){
						$("#contractEnd").html(data.obj[i].count);
						$("#acontractEnd").click(function(){
							window.location.href=url;//切位订单
						});
					}else if(prefix.type == 7){
						$("#contractCancel").html(data.obj[i].count);
						$("#acontractCancel").click(function(){
							window.location.href=url;//切位订单
						});
					}else if(prefix.type == 8){
						$("#ticketSuccess").html(data.obj[i].count);
						$("#aticketSuccess").click(function(){
							window.location.href=url;//出票完成
						});
					};
						
				};
			},
			error:function(msg){
				layer.alert("请检查您的网络连接，然后重试！");
			}
		});
	};
	getInformation();
})
</script>

<ul class="information"> 
    <li id="arechargeCheck"><span>充值审核结果(<span id="rechargeCheck"></span>)</span></li>
    <li id="awithdrawCheck"><span>提现审核结果(<span id="withdrawCheck"></span>)</span></li>
    <li id="aticketPay"><span>票款付款结果(<span id="ticketPay"></span>)</span></li>
    <li id="awithdrawPay"><span>押金付款结果(<span id="withdrawPay"></span>)</span></li>
    <li id="acontractCheck"><span>合同审核结果(<span id="contractCheck"></span>)</span></li>
    <li id="acontractEnd"><span>合同终止(<span id="contractEnd"></span>)</span></li>
    <li id="acontractCancel"><span>合同取消(<span id="contractCancel"></span>)</span></li>
    <li id="aticketSuccess" class="borBotNo"><span>出票完成提醒(<span id="ticketSuccess"></span>)</span></li>
</ul>
<div class="userNameBox">
    <ul class="userName">
        <li class="left userName1">欢迎,<span id="userName">${sessionInfo.name}</span></li>
        <li class="left newsRemind" id="newsRemind">消息</li>
        <li class="right exit" onclick="editUserPwd()">修改密码</li>
        <li class="right exit" onclick="logout()">退出<img src="${ctx }/image/exit.gif"></li>
        <li class="right aboutUs">关于我们</li>
    </ul>
</div>
<!-- 一级导航 -->
<div class="navBox">
    <ul class="nav">
        <a href="${ctx }/admin/index"><li class="logo"><img src="${ctx }/image/logo.png"></li></a>
        ${sessionScope.resourceFirst}
    </ul>
</div>
<!-- 二级导航 -->
<div class="navSecBox">
	${sessionScope.resourceSecond}
</div>